<!doctype html>
<html  class="x-admin-sm">
<head>
    @include('common.meta')

    @include('common.script')
</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">后台管理登录</div>
        <div id="darkbannerwrap"></div>
{{--        @if(count($errors) > 0)--}}
{{--            <div class="alert alert-danger">--}}
{{--                <ul>--}}
{{--                @foreach($errors->all() as $message)--}}
{{--                    <li>{{ $message }}</li>--}}
{{--                @endforeach--}}
{{--                </ul>--}}
{{--            </div>--}}
{{--        @endif--}}
        <form action="dologin" method="post" enctype="multipart/form-data" class="layui-form" >
            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
            <input name="username" placeholder="用户名" value="{{ old('username')}}" type="text" lay-verify="required" class="layui-input" >

            @if($errors->has('username'))
                <div class="alert alert-danger" style="color: red;">{{ $errors->first('username') }}</div>
            @endif

            <hr class="hr15">
            <input name="password" autocomplete value="{{ old('password') }}" placeholder="密码" lay-verify="required"  type="password" class="layui-input">

            @if($errors->has('password'))
                <div class="alert alert-danger" style="color: red;">{{ $errors->first('password') }}</div>
            @endif

            <hr class="hr15">
            <input name="imgcode" style="width: 150px;float: left;" lay-verify="required" placeholder="验证码"  type="text" class="layui-input">
            <img src="{{ URL('admin/VCode') }}" style="float: right" alt="验证码" title="刷新图片" onclick="this.src=this.src+'?'+Math.random();">
            <hr class="hr15">

            @if(count($errors->imgcode) > 0)
                <div class="alert alert-danger" style="color: red;">{{ $errors->imgcode->first() }}</div>
            @endif
            @if(count($errors->admin) > 0)
                <div class="alert alert-danger" style="color: red;">{{ $errors->admin->first() }}</div>
            @endif
            @if(count($errors->password) > 0)
                <div class="alert alert-danger" style="color: red;">{{ $errors->password->first() }}</div>
            @endif
            <hr class="hr15">
            <input value="登录" lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>

    <script>
        $(function  () {
            layui.use('form', function(){
              var form = layui.form;
              // layer.msg('玩命卖萌中', function(){
              //   //关闭后的操作
              //   });
              //监听提交
              // form.on('submit(login)', function(data){
              //     $.post('dologin',data.field,function (res){
              //
              //     })
              //   return false;
              // });
            });
        })
    </script>
    <!-- 底部结束 -->
    <script>
    //百度统计可去掉
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</body>
</html>